interface ConvertorCreator {
    Convertor getConvertor();
}

interface Convertor {
    public String transform();
}

class DBConvertorCreator implements ConvertorCreator {
    public Convertor getConvertor() {
        return new DBConvertor();
    }
}

class TXTConvertorCreator implements ConvertorCreator {
    public Convertor getConvertor() {
        return new TXTConvertor();
    }
}

class DBConvertor implements Convertor {
    public String transform() {
        return "数据库数据转换为XML-实现代码省略";
    }
}

class TXTConvertor implements Convertor {
    public String transform() {
        return "txt数据转换为XML-实现代码省略";
    }
}

class Test {
    public static void main(String args[]) {
        ConvertorCreator creator;
        Convertor convertor;
        creator = new DBConvertorCreator();
        convertor = creator.getConvertor();
        System.out.println(convertor.transform());
    }
}
